home *** CD-ROM | disk | FTP | other *** search
- property CurrentState, MemberOne, MemberTwo, name, GroupName
-
- on getPropertyDescriptionList
- set description to [:]
- addProp(description, #MemberOne, [#default: 1, #format: #integer, #comment: "Cast member for state 1:"])
- addProp(description, #MemberTwo, [#default: 1, #format: #integer, #comment: "Cast member for state 2:"])
- addProp(description, #CurrentState, [#default: 1, #format: #integer, #comment: "Which state to begin in (1 or 2):", #range: [#min: 1, #max: 2]])
- addProp(description, #name, [#default: #twostate1, #format: #symbol, #comment: "Name:"])
- addProp(description, #GroupName, [#default: #group1, #format: #symbol, #comment: "Groupname:"])
- return description
- end
-
- on getBehaviorDescription
- return "Switch members when addressed"
- end
-
- on getAssocMembers
- set myPropList to [MemberOne, MemberTwo]
- return myPropList
- end
-
- on SwitchStates me, Addressee
- case Addressee of
- #all:
- do_SwitchStates(me)
- (the name of me):
- do_SwitchStates(me)
- (the GroupName of me):
- do_SwitchStates(me)
- end case
- end
-
- on do_SwitchStates me
- if the CurrentState of me = 0 then
- set the CurrentState of me to 1
- set the member of sprite the spriteNum of me to the MemberOne of me
- else
- set the CurrentState of me to 2
- set the member of sprite the spriteNum of me to the MemberTwo of me
- end if
- end
-